package com.netease.c;

public class q
{
  static final String a = "0123456789ABCDEF";

  public static String a(String paramString)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    int i = 0;
    if (i < paramString.length())
    {
      char c = paramString.charAt(i);
      if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')) || (".-*_".indexOf(c) > -1))
        localStringBuffer.append(c);
      while (true)
      {
        i++;
        break;
        if (c == ' ')
        {
          localStringBuffer.append("%20");
          continue;
        }
        char[] arrayOfChar = new char[1];
        arrayOfChar[0] = c;
        byte[] arrayOfByte = new String(arrayOfChar).getBytes();
        for (int j = 0; j < arrayOfByte.length; j++)
        {
          localStringBuffer.append('%');
          localStringBuffer.append("0123456789ABCDEF".charAt((0xF0 & arrayOfByte[j]) >> 4));
          localStringBuffer.append("0123456789ABCDEF".charAt(0xF & arrayOfByte[j]));
        }
      }
    }
    return localStringBuffer.toString();
  }

  public static String a(String paramString1, String paramString2)
  {
    String str;
    if ((paramString1 == null) || (paramString2 == null))
      str = null;
    while (true)
    {
      return str;
      try
      {
        "".getBytes(paramString2);
        label19: StringBuffer localStringBuffer = new StringBuffer();
        int i = 0;
        int j = -1;
        if (i < paramString1.length())
        {
          char c = paramString1.charAt(i);
          if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')) || (" .-*_".indexOf(c) > -1))
          {
            if (j >= 0)
            {
              a(paramString1.substring(j, i), localStringBuffer, paramString2);
              j = -1;
            }
            if (c != ' ')
              localStringBuffer.append(c);
          }
          while (true)
          {
            i++;
            break;
            localStringBuffer.append("%20");
            continue;
            if (j >= 0)
              continue;
            j = i;
          }
        }
        if (j >= 0)
          a(paramString1.substring(j, paramString1.length()), localStringBuffer, paramString2);
        str = localStringBuffer.toString();
      }
      catch (Exception localException)
      {
        break label19;
      }
    }
  }

  private static void a(String paramString1, StringBuffer paramStringBuffer, String paramString2)
  {
    try
    {
      byte[] arrayOfByte = paramString1.getBytes(paramString2);
      for (int i = 0; i < arrayOfByte.length; i++)
      {
        paramStringBuffer.append("%");
        char c1 = "0123456789ABCDEF".charAt((0xF0 & arrayOfByte[i]) >> 4);
        char c2 = "0123456789ABCDEF".charAt(0xF & arrayOfByte[i]);
        paramStringBuffer.append(c1);
        paramStringBuffer.append(c2);
      }
    }
    catch (Exception localException)
    {
    }
  }

  public static String b(String paramString1, String paramString2)
  {
    String str;
    if ((paramString1 == null) || (paramString2 == null))
      str = null;
    while (true)
    {
      return str;
      try
      {
        "".getBytes(paramString2);
        label19: StringBuffer localStringBuffer = new StringBuffer();
        int i = 0;
        int j = -1;
        if (i < paramString1.length())
        {
          char c = paramString1.charAt(i);
          if (((c >= 'a') && (c <= 'z')) || ((c >= 'A') && (c <= 'Z')) || ((c >= '0') && (c <= '9')) || (" .-_~".indexOf(c) > -1))
          {
            if (j >= 0)
            {
              a(paramString1.substring(j, i), localStringBuffer, paramString2);
              j = -1;
            }
            if (c != ' ')
              localStringBuffer.append(c);
          }
          while (true)
          {
            i++;
            break;
            localStringBuffer.append("%20");
            continue;
            if (j >= 0)
              continue;
            j = i;
          }
        }
        if (j >= 0)
          a(paramString1.substring(j, paramString1.length()), localStringBuffer, paramString2);
        str = localStringBuffer.toString();
      }
      catch (Exception localException)
      {
        break label19;
      }
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.c.q
 * JD-Core Version:    0.6.0
 */